<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<?php echo $this->url->getBaseUri() ?>public/back/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->url->getBaseUri() ?>public/back/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->url->getBaseUri() ?>public/back/Css/style.css" />
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/jquery.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/bootstrap.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/ckform.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form  id='frm1' class="form-inline definewidth m20" action="<?php echo $this->url->getBaseUri() ?>admin/Admin/index" method="post">  
    管理员名称：
    <input type="text" name="name" id="rolename"class="abc input-default" placeholder="" value="">&nbsp;&nbsp; 
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; 
</form>

<table class="table table-bordered table-hover definewidth m10" >
    <thead>
    <tr>
        <th>管理员</th>
        <th>管理员权限</th>
        <th>管理员状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <?php foreach($page->items  as $admin) { 
           $state=$admin->state;
           switch ($state) {
                            case 1:
                                $state='允许登陆';
                                break;
                            case 2:
                                $state='禁止登陆';
                                break;
                            default:
                                $state='状态错误';
                                break;
                        }
    ?>
         <tr class="tdd">
            <td><?php echo $admin->name ?></td>
            <td><?php echo $admin->acl ?></td>
            <td><?php echo $state ?></td>
            <td>
               <a href="<?php echo $this->url->getBaseUri() ?>admin/Admin/edit/<?php echo $admin->id ?>/<?php echo $currentPage;?>/<?php echo $name;?>">编辑</a>
               <a href="<?php echo $this->url->getBaseUri() ?>admin/Admin/del/<?php echo $admin->id ?>">删除</a>
            </td>
        </tr>
    <?php } ?>
        <tr>
            <td colspan="11" align="right" style="text-align:right">
            <a href="<?php echo $this->url->getBaseUri() ?>admin/Admin/index/1/<?php echo $name;?>">第一页</a>
            <a href="<?php echo $this->url->getBaseUri() ?>admin/Admin/index/<?php echo $page->before; ?>/<?php echo $name;?>">上一页</a>
            <a href="<?php echo $this->url->getBaseUri() ?>admin/Admin/index/<?php echo $page->next; ?>/<?php echo $name;?>">下一页</a>
            <a href="<?php echo $this->url->getBaseUri() ?>admin/Admin/index/<?php echo $page->last; ?>/<?php echo $name;?>">最后一页</a>
            <?php echo "页码 ", $page->current, " 总页数 ", $page->total_pages; ?>
            </td>
         </tr>   
</table>

</body>
</html>
<script>
    $(function () {

        $('.tdd td').each(function(){
        if($(this).text() == "禁止登陆"){
        $(this).css('color','red');
      }
    });



    });

</script>